<?php 
defined('RUN_KATANA') or die('Restricted access');
echo $commander->getListCommandsPanel('sa', ''); 
if(is_object($adc->getCurrentAdType())):
$forms = $fc->getForms();
?>
<fieldset class="edit_form">
	<label for="Title"><?php echo ucfirst($txt->getWord('title')); ?></label>
    <?php echo $commander->getErrorField('Title'); ?>
    <?php echo $commander->getInfoField('Title'); ?>
    <input name="Title" class="medium" type="text" value="<?php echo $adc->CurrentAdType->getTitle(); ?>" maxlength="80" />
	
	<label for="TitleEn"><?php echo ucfirst($txt->getWord('Title')); ?> (En)</label>
    <?php echo $commander->getErrorField('TitleEn'); ?>
    <?php echo $commander->getInfoField('TitleEn'); ?>
    <input name="TitleEn" class="medium" type="text" value="<?php echo $adc->CurrentAdType->getTitleEn(); ?>" maxlength="80" />
	
    <label for="FormId"><?php echo ucfirst($txt->getWord('selling').' '.$txt->getWord('form')); ?></label>
    <?php echo $commander->getErrorField('FormId'); ?>
    <?php echo $commander->getInfoField('FormId'); ?>
    <select class="medium" name="FormId" onchange="submit();">
        <option value="--" <?php echo getIsSelectedHTML($adc->CurrentAdType->getFormId(), 0); ?>><?php echo ucfirst($txt->getWord('undefined')); ?></option>
        <?php 
        if($forms)
        {
            foreach($forms as $form)
            { echo '<option value="'.$form->getId().'" '.getIsSelectedHTML($adc->CurrentAdType->getFormId(), $form->getId()).'>'.$form->getTitle().'</option>'; }
        }
        ?>
    </select>
	
	<label for="FormBuyId"><?php echo ucfirst($txt->getWord('buying').' '.$txt->getWord('form')); ?></label>
    <?php echo $commander->getErrorField('FormBuyId'); ?>
    <?php echo $commander->getInfoField('FormBuyId'); ?>
    <select class="medium" name="FormBuyId" onchange="submit();">
        <option value="--" <?php echo getIsSelectedHTML($adc->CurrentAdType->getFormBuyId(), 0); ?>><?php echo ucfirst($txt->getWord('undefined')); ?></option>
        <?php
        if($forms)
        {
            foreach($forms as $form)
            { echo '<option value="'.$form->getId().'" '.getIsSelectedHTML($adc->CurrentAdType->getFormBuyId(), $form->getId()).'>'.$form->getTitle().'</option>'; }
        }
        ?>
    </select>
	
	<label for="AdTypeObject"><?php echo ucfirst($txt->getWord('object').' '.$txt->getWord('type')); ?></label>
    <?php echo $commander->getErrorField('AdTypeObject'); ?>
    <?php echo $commander->getInfoField('AdTypeObject'); ?>
	<select class="medium" name="AdTypeObject" onchange="submit();">
		<?php 
		echo '<option value="Ad" '.$txt->getIsSelectedHTML($adc->CurrentAdType->getAdTypeObject(), 'Ad') .'>'.ucfirst($txt->getWord('ad')).'</option>';
		echo '<option value="AdVehicle" '.$txt->getIsSelectedHTML($adc->CurrentAdType->getAdTypeObject(), 'AdVehicle') .'>'.ucfirst($txt->getWord('vehicle').' '.$txt->getWord('ad')).'</option>';
		echo '<option value="AdTransport" '.$txt->getIsSelectedHTML($adc->CurrentAdType->getAdTypeObject(), 'AdTransport') .'>'.ucfirst($txt->getWord('transport').' '.$txt->getWord('ad')).'</option>';
		echo '<option value="AdEmployment" '.$txt->getIsSelectedHTML($adc->CurrentAdType->getAdTypeObject(), 'AdEmployment') .'>'.ucfirst($txt->getWord('employment').' '.$txt->getWord('ad')).'</option>';
		?>
	</select>
	
	<label for="Image"><?php echo ucfirst($txt->getWord('image')); ?></label>
	<?php echo $commander->getErrorField('Image'); ?>
    <?php echo $commander->getInfoField('Image'); ?>
	
	<?php if($adc->CurrentAdType->getImage() != ''):  ?>
	<img src="<?php echo ADTYPE_URL.$adc->CurrentAdType->getImage(); ?>" />&nbsp;&nbsp;
	<a onmousedown="jQuery('#ImageDelete').val(1);" onmouseup="jQuery('#edit_form').submit();"><img title="<?php echo ucfirst($txt->getWord('delete').' '.$txt->getWord('image')); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>delete_16.gif" /></a><br />
	<input type="hidden" id="ImageDelete" name="ImageDelete" value="0" /><br />
	<?php else:  ?>
    <input name="Image" class="medium" type="file" /><br />
	<?php endif;  ?>
    <label for="Description"><?php echo ucfirst($txt->getWord('description')); ?></label>
    <?php echo $commander->getErrorField('Description'); ?>
    <?php echo $commander->getInfoField('Description'); ?>
    <textarea name="Description" class="medium limit_500 autogrow"><?php echo $adc->CurrentAdType->getDescription(); ?></textarea>
</fieldset>
<?php endif; ?>